-
Notifications
You must be signed in to change notification settings - Fork 149
fix: Bug: Date picker controls cause MFE error on Safari #2343 #2352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
dae8aa6
to
5875516
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2352 +/- ##
==========================================
+ Coverage 94.50% 94.60% +0.10%
==========================================
Files 1171 1174 +3
Lines 25149 25409 +260
Branches 5374 5550 +176
==========================================
+ Hits 23766 24038 +272
+ Misses 1320 1308 -12
Partials 63 63 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7ad0fea
to
26a5feb
Compare
26a5feb
to
7bac405
Compare
@bradenmacdonald I’ve upgraded Also, there are some lines marked as uncovered in the Codecov report that I haven’t modified. We should decide how to proceed with those. If you review the coverage report, you’ll notice that the uncovered lines were not part of my changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks great!
const formattedDate = moment(testData.date).format(COMMA_SEPARATED_DATE_FORMAT); | ||
createCourseUpdateQuery.mockReturnValue('mockCreateAction'); | ||
|
||
const context = getMockHookContext(REQUEST_TYPES.add_new_update); | ||
const submitFn = (data) => { | ||
const date = moment(data.date).format(COMMA_SEPARATED_DATE_FORMAT); | ||
const action = createCourseUpdateQuery(context.courseId, { | ||
date, | ||
content: data.content, | ||
}); | ||
context.closeUpdateForm(); | ||
context.setCurrentUpdate(context.initialUpdate); | ||
context.dispatch(action); | ||
}; | ||
|
||
submitFn(testData); | ||
|
||
expect(createCourseUpdateQuery).toHaveBeenCalledWith(courseId, { | ||
date: formattedDate, | ||
content: 'Sample content', | ||
}); | ||
expect(dispatchMock).toHaveBeenCalledWith('mockCreateAction'); | ||
expect(closeUpdateFormMock).toHaveBeenCalled(); | ||
expect(setCurrentUpdateMock).toHaveBeenCalledWith(expect.objectContaining({ id: 0 })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future, I recommend trying to figure out how to write these tests without so much mocking, by interacting with the UI instead. Tests like this get very hard to maintain over time and end up duplicating a lot of the logic of the thing they're trying to test.
Thanks for the pull request, @ahtesham-quraish! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Submit a signed contributor agreement (CLA)
If you've signed an agreement in the past, you may need to re-sign. Once you've signed the CLA, please allow 1 business day for it to be processed. 🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
@ahtesham-quraish CC @mphilbrick211 I wanted to merge this now, but the CLA check is no longer passing. Do you know why? It was green last week. |
@bradenmacdonald checking on this for you! |
@ahtesham-quraish @bradenmacdonald there was a typo on our side, but it's fixed now. CLA should turn green now, but might take up to 24 hours. |
Thanks @mphilbrick211 ! @ahtesham-quraish could you please rebase this or just merge master into it, and that should re-trigger the checks? Hopefully the CLA and codecov checks will be passing and then I'll merge it for you. |
5e704eb
to
2428da9
Compare
@bradenmacdonald I have tried to ignore the lines which are causing low coverage but its not working at all for some cases like in SS you can see that I have tried to ignore the line but it still keeps saying the line is uncovered. Can you please look into this? Everything else is working like dependency is upgraded and tests are added. |
@ahtesham-quraish you need to change the However, you've also added too many |
8dc9001
to
7dd6dee
Compare
@bradenmacdonald thank you for pointing out the issue I missed it. I have removed the |
3a9fd1d
to
d95e8ca
Compare
Hmm, thanks for that update @ahtesham-quraish but I think there's still too many |
fix: merge with master
d95e8ca
to
badaa33
Compare
@bradenmacdonald thank you for highlighting the this. You can merge the PR. |
@ahtesham-quraish It's almost working, but when I click on on of the time fields, it's causing an error: ![]()
|
Description
Bug: #2323
Supporting information
Link to other information about the change, such as GitHub issues, or Discourse discussions.
Be sure to check they are publicly readable, or if not, repeat the information here.
Testing instructions
Please provide detailed step-by-step instructions for manually testing this change.
Other information
Include anything else that will help reviewers and consumers understand the change.
Best Practices Checklist
We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:
.ts
,.tsx
).propTypes
,defaultProps
, andinjectIntl
patterns are not used in any new or modified code.src/testUtils.tsx
(specificallyinitializeMocks
)apiHooks.ts
in this repo for examples.messages.ts
files have adescription
for translators to use.../
. To import from parent folders, use@src
, e.g.import { initializeMocks } from '@src/testUtils';
instead offrom '../../../../testUtils'